package cn.com.huzo.repository.inventory.impl;

import cn.com.huzo.model.entities.inventory.MaterialInventoryBookHeaderEntity;
import cn.com.huzo.repository.inventory.MaterialInventoryBookHeaderRepository;
import huzofw.repository.impl.GenericRepositoryImpl;
import huzofw.repository.impl.MyBatisDaoUtils;
import java.util.HashMap;
import java.util.Map;
import org.springframework.stereotype.Repository;

/**
 * 材料库存台账表头据访问对象访问对象。
 *
 * @author 吴旭
 */
@Repository("MaterialInventoryBookHeaderRepository")
public class MaterialInventoryBookHeaderRepositoryImpl extends GenericRepositoryImpl<MaterialInventoryBookHeaderEntity, HashMap>
        implements MaterialInventoryBookHeaderRepository {

    private final String namespace = "cn.com.huzo.repository.inventory.MaterialInventoryBookRepository";

    /**
     * 构造函数,设置the instance to ProductRepositoryImpl.class.
     */
    public MaterialInventoryBookHeaderRepositoryImpl() {
        super(MaterialInventoryBookHeaderEntity.class);
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public MaterialInventoryBookHeaderEntity fetchMaterialInventoryBookHeader(String styleNo) {
        Map<String, Object> criterion = new HashMap();
        criterion.put("StyleNo", styleNo);

        return getSqlSession().selectOne(MyBatisDaoUtils.getMapperQueryId(
                namespace, "fetchMaterialInventoryBookHeader"), criterion);
    }
}
